home *** CD-ROM | disk | FTP | other *** search
- /* ProcessWatcher AppleEvents Suite
- */
-
- #pragma once
-
- // PW signature
-
- #define kPWSignature 'YgzP'
-
- // Event Class
-
- #define kAEPWEventClass kPWSignature
-
- // Events
-
- #define kAEPWGetProcessList 'glis'
- #define kAEPWGetProcessInfo 'ginf'
- #define kAEPWKill 'kill'
- #define kAEPWBringToFront 'fron'
-
- #define keyPWTargetProcess 'prtg' // typeProcessSerialNumber
-
- #define typePWProcessList 'plis'
- /*
- typePWProcessList defines an array of ProcessListRec :
-
- typedef struct {
- ProcessSerialNumber psn; // Process serial number
- Str31 name; // Pascal string (process name)
- } ProcessListRec;
-
- The number of processes is given by deviding the data size by
- sizeof(ProcessListRec).
- Be very careful that desk accessories names begin with the NULL
- character, so there may be some problems converting process names
- to C strings.
- */
- #define typePWProcessInfo 'pinf'
- /*
- typePWProcessInfo defines a ProcessInfoRec record
- size: sizeof(ProcessInfoRec)
- "bug": the processName and processAppSpec field are set to nil,
- but you should already know the name from the get process list
- Apple Event.
- Note: the launch date of the ProcessInfoRec is in fact the real date
- and time when the process was launched, and not the number of ticks elapsed
- between boot and launch.
- */
-
- /*
- ********************************************************************************
- Get processes list
- ==================
-
- Event Class kAEPWEventClass
- Event ID kAEPWGetProcessList
-
- Parameters
- ----------
- None
-
- Reply parameters
- ----------------
- keyAEResult An array of structures giving process serial numbers
- and name of all processes running on the machine.
-
- Descriptor type typePWProcessList
- Required
- Size multiple of sizeof(ProcessListRec)
-
- keyErrorNumber The result code for the event
- Descriptor type typeLongInteger
- Optional (the abscence of parameter means no error happened)
- Size 4 bytes
- ********************************************************************************
- Get process info
- ================
-
- Event Class kAEPWEventClass
- Event ID kAEPWGetProcessInfo
-
- Parameters
- ----------
- keyDirectObject The process for which information is desired.
-
- Descriptor type typeProcessSerialNumber
- Required
- Size sizeof(ProcessSerialNumber)
-
- Reply parameters
- ----------------
- keyAEResult A ProcessInfoRec giving the process information.
-
- Descriptor type typePWProcessInfo
- Required
- Size sizeof(ProcessInfoRec)
-
- keyErrorNumber The result code for the event
- Descriptor type typeLongInteger
- Optional (the abscence of parameter means no error happened)
- Size 4 bytes
- ********************************************************************************
- Kill process
- ============
-
- Event Class kAEPWEventClass
- Event ID kAEPWKill
-
- Parameters
- ----------
- keyDirectObject The process for which information is desired.
-
- Descriptor type typeProcessSerialNumber
- Required
- Size sizeof(ProcessSerialNumber)
-
- Reply parameters
- ----------------
- keyErrorNumber The result code for the event
- Descriptor type typeLongInteger
- Optional (the abscence of parameter means no error happened)
- Size 4 bytes
- ********************************************************************************
- Bring process to front
- ======================
-
- Event Class kAEPWEventClass
- Event ID kAEPWBringToFront
-
- Parameters
- ----------
- keyDirectObject The process for which information is desired.
-
- Descriptor type typeProcessSerialNumber
- Required
- Size sizeof(ProcessSerialNumber)
-
- Reply parameters
- ----------------
- keyErrorNumber The result code for the event
- Descriptor type typeLongInteger
- Optional (the abscence of parameter means no error happened)
- Size 4 bytes
- ********************************************************************************
- */
-